package com.aaa.controller;

import com.aaa.entity.DictData;
import com.aaa.entity.User;
import com.aaa.service.DictDataService;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @BelongsPackage: com.aaa.controller.api
 * @Description:
 * @CreateTime: 2023-03-22  19:13
 * @Author: ql
 */

@RestController
@RequestMapping("/system/dict/data")
public class DictDataController {

    @Autowired
    private DictDataService dictDataService;

    @GetMapping("findByType/{type}")
    public Result<List<DictData>> list(@PathVariable String type){
        return dictDataService.findByType(type);
    }


    @GetMapping("listType/{type}")
    public List<DictData> listType(@PathVariable String type){
        return dictDataService.listType(type);
    }
}
